package com.zhixiang.wbl.visitor.Utils;

/**
 * Created by dongzhixiang on 16/5/18.
 */
public class DistanceUtil
{
    public static String getDistanceString(double meter)
    {
        if (meter<100) return  (int)(meter) + "米";
        else if (meter>=100&&meter<1000) return String.format("%.2f",meter/1000)+"公里";
        else if (meter>=1000&&meter<10000)
        {
          return String.format("%.1f",meter/1000)+"公里";
        }
        else
        {
            return (int)(meter/1000)+"公里";
        }
    }
}
